public class t53 {
    public static void main(String[] args) {
        int arr[] = {-1,-2};
        int n = arr.length;


        int dp [] = new int[n];
        dp[0] = arr[0];
       int max = dp[0];

        for(int i =1;i<n;i++){
            dp[i] = Math.max(dp[i-1]+arr[i],arr[i]);
            max =Math.max(max,dp[i]);
        }

        System.out.println(max);
    }
}
